/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fsflightplanner;

import java.net.URLEncoder;
import org.jdesktop.swingx.mapviewer.DefaultTileFactory;
import org.jdesktop.swingx.mapviewer.TileFactory;
import org.jdesktop.swingx.mapviewer.TileFactoryInfo;

/**
 *
 * @author Matt
 */
public class GoogleMapsTileProvider {

    private static final String VERSION = "2.75";
    private static final String KEY = "ABQIAAAArODGmfFsbeCeKXthyfE9xhSu-v22TjmOCnsGh6hW9FSEwKNSuxRw-of95Z61_YsEwKp_NS5LWQ9pLw";
    private static final int minZoom = 1;
    private static final int maxZoom = 16;
    private static final int mapZoom = 17;
    private static final int tileSize = 256;
    private static final boolean xr2l = true;
    private static final boolean yt2b = true;
    /*
    private static final String baseURL =
            "maps.google.com/maps?file=api" +
            //"&v=" + VERSION +
            "&key=" + KEY;
     * 
     */
      private static final String baseURL =
            "http://maps.google.com/maps/api/geocode/json?sensor=false&address=" + URLEncoder.encode("Kingston, Jamaica") +
            //"&v=" + VERSION +
            "&key=" + KEY;
    private static final String x = "x";
    private static final String y = "y";
    private static final String z = "zoom";
    private static final TileFactoryInfo GOOGLE_MAPS_TILE_INFO = new TileFactoryInfo(
            minZoom, maxZoom, mapZoom, tileSize, xr2l,
            yt2b, baseURL, x, y, z);

    public static TileFactory getDefaultTileFactory() {
        return (new DefaultTileFactory(
                GOOGLE_MAPS_TILE_INFO));
    }
}
//http://maps.google.com/maps?file=api&v=2.62&amp;key=ABQIAAAAfAb2RNhzPaf0-W1mtifapBSywvU8c62IENdIncxTHYhvIRDqDxSzSDb53qUF8He5H3dhSY8v3JxneA

//http://maps.google.com/maps/geo?q=
//{URLEncoder.encode(address)}&output=xml&key=${googleKey}".toURL()